package com.cloud.pole.pay.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.cloud.pole.common.util.MoneyUtil;
import com.cloud.pole.common.util.UUIDUtils;
import com.cloud.pole.pay.common.ccbpay.CcbPayConfig;
import com.cloud.pole.pay.service.PayCcbService;

@Service
public class PayCcbServiceImpl implements PayCcbService {
	
	/**
	  * 建行app内支付
	 */
	@Override
	public Map<String, Object> threeStarPayInApp(Integer payId, String payNo, Long amount) throws Exception {
		String mac = CcbPayConfig.CcbMd5(payNo, MoneyUtil.getCentToDollar(amount));
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mac", mac);
		map.put("payinfo",  CcbPayConfig.CcbAppPayGetInfo(payNo, MoneyUtil.getCentToDollar(amount)));
		map.put("result", CcbPayConfig.CcbPayGetUrl(payNo, MoneyUtil.getCentToDollar(amount)));
		return map;
	}
}
